#!/bin/bash

filename="mysql.rrd"

while true; do
    SELECT=$(mysql -uroot -p1234 --batch -e "show global status like 'com_select'" | awk '/Com_select/{print $2}')
    rrdtool update $filename N:$SELECT
    sleep 3
done
